{include file="public/header" /}
<body class="bg-white">
    <header class="all-header">
        <p class="all-header-item">
            <i class="layui-icon layui-icon-left" onclick="window.history.back(-1)"></i>
        </p>
        <p class="all-header-item">律师合作</p>
    </header>
    <form method="post" id="from">
        <div class="flex-box-input border-bottom1">
            <label class="fbi-item" for="lc-username">
                <span class="color-red">*</span>姓名：</label>
            <input class="fbi-item" type="text" name="name" id="lc-username" placeholder="请输入姓名" />
        </div>
        <div class="flex-box-input border-bottom1">
            <label class="fbi-item" for="lc-usertel">
                <span class="color-red">*</span>电话：</label>
            <input class="fbi-item"  name="phone"  type="tel" id="lc-usertel" placeholder="请输入号码" />
        </div>
        <div class="flex-box-input border-bottom1">
            <label class="fbi-item" for="lc-useraddr">
                <span class="color-red">*</span>所在地区：</label>
            <input class="fbi-item" type="text" name="address" id="lc-useraddr" placeholder="请输入所在律所" />
        </div>
        <button class="city-btn bg-yellow" type="submit">一键入住</button>
    </form>

</body>
    <script>
        layui.use(['form'],function () {
            var form = layui.form;
            $("#from").submit(function (e) {
                e.preventDefault();
                var list = $(this).serialize();
                $.post("{:url('lawyer_cooperate/add')}",list,function (data) {
                    if(data.code == 1){
                        layer.msg(data.msg);
                        setTimeout(function () {
                            location.reload();
                        },2000);
                    }else{
                        layer.msg(data.msg);
                    }
                })
            })
            form.render();
        })
    </script>
</html>